home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Xconq 7.1.0 / lib / russian-rev.g < prev    next >
Encoding:
Text File  |  1996-04-04  |  11.9 KB  |  515 lines  |  [TEXT/XCNQ]

  1. (game-module "russian-rev"
  2.   (title "Russian Revolution")
  3.   (blurb "The Russian Revolution")
  4.   (variants ; copied from standard.g
  5.     (world-seen false)
  6.     (see-all false)
  7.     (world-size (60 30 360))
  8.     ("Mostly Land" mostly-land
  9.       (true
  10.         (add sea alt-percentile-max 20)
  11.         (add shallows alt-percentile-min 20)
  12.         (add shallows alt-percentile-max 21)
  13.         (add swamp alt-percentile-min 21)
  14.         (add swamp alt-percentile-max 23)
  15.         (add (desert plains forest) alt-percentile-min 21)
  16.         ))
  17.     ("All Land" all-land
  18.       (true
  19.         (add sea alt-percentile-max 1)
  20.         (add shallows alt-percentile-min 1)
  21.         (add shallows alt-percentile-max 2)
  22.         (add swamp alt-percentile-min 2)
  23.         (add swamp alt-percentile-max 4)
  24.         (add (desert plains forest) alt-percentile-min 2)
  25.         ))
  26.     ("Large Countries" large
  27.      (true (set country-radius-max 100))
  28.      )
  29.     )
  30. )
  31.  
  32. (unit-type militia (char "m") (image-name "fremen")
  33.   (help "cheap, weaker than infantry, good for patrol and exploration")
  34. )
  35. (unit-type infantry (char "i") (image-name "soldiers")
  36.   (help "the backbone of the army, captures cities, makes forts")
  37. )
  38. (unit-type cavalry (char "c") (image-name "cavalry")
  39.   (help "fast, explores and fights, good for exploration and reserve")
  40. )
  41. (unit-type police (char "p") (image-name "police")
  42.   (help "spies, fights terrorists, captures neutral troops")
  43. )
  44. (unit-type terrorist (char "t") (image-name "terrorist")
  45.   (help "sneaks around, infiltrates, blows up things")
  46. )
  47. (unit-type train (char "T") (image-name "train")
  48.   (help "moves troops on land, very vulnerable")
  49. )
  50. (unit-type fleet (char "n") (image-name "ca")
  51.   (help "fights and carries troops on sea")
  52. )
  53. (unit-type fort (char "/") (image-name "walltown")
  54.   (help "fort, port and canal")
  55. )
  56. (unit-type town (char "*") (image-name "town20") 
  57.   (help "smaller than a city")
  58. )
  59.  (unit-type city (char "@") (image-name "city19")
  60.   (help "main producer")
  61. )
  62.  
  63. (define m militia)
  64. (define i infantry)
  65. (define c cavalry)
  66. (define p police)
  67. (define t terrorist)
  68. (define T train)
  69. (define n fleet)
  70. (define / fort)
  71. (define * town)
  72. (define @ city)
  73.  
  74. (material-type fuel (help "to move your trains and ships"))
  75. (material-type food (help "to survive"))
  76. (material-type ammo (help "to fight"))
  77.  
  78. (include "stdterr")
  79. ;; to use "stdterr" as it stands:
  80. (add road name "railway")
  81. (add road image-name "road")
  82. (define railway road)
  83.  
  84. (define cities (* @))
  85. (define places (/ * @))
  86. (define troops (m i c))
  87. (define ground (m i c p t))
  88. (define movers (m i c p t T n))
  89. (define water (sea shallows))
  90. (define land (swamp plains forest desert mountains))
  91. (define dry-land (desert plains forest mountains)) ; same as land-t*
  92. ;;; Static relationships.
  93.  
  94. (table vanishes-on
  95.   (ground water true)
  96.   (places (sea shallows swamp) true)
  97.   (n land true)
  98.   (n railway true)
  99.   (u* ice true)
  100.   (T t* true)
  101.   (T railway false)
  102. )
  103.  
  104. ;; Unit-unit capacities.
  105.  
  106. (table unit-size-as-occupant
  107.   (u* u* 500)
  108. ;             m i c p t T  n
  109.   (movers u* (1 2 2 1 1 6 15))
  110. )
  111. (add (T n / * @) capacity (4 10 20 100 200))
  112. (table occupant-max
  113.   (u* u* 100)
  114. )
  115.  
  116. (table road-chance
  117.   (town (town city) ( 1  5))
  118.   (city (town city) (10 90))
  119.   )
  120.  
  121. ;;; Unit-terrain capacities.
  122.  
  123. ;; Limit units from 4 to 16 in one cell.
  124. ;;  Places cover the entire cell, however.
  125.   
  126. (table unit-size-in-terrain
  127.   (m t* 2)
  128.   ((i c n T) t* 4)
  129.   ((p t) t* 1)
  130.   (places t* 16)
  131. )
  132. (add t* capacity 16)
  133. (add railway capacity 4)
  134. (table terrain-capacity-x (T railway 2))
  135.  
  136. ;;; Unit-material capacities.
  137.  
  138. (table unit-storage-x
  139. ;            m  i  c p t  T   n   /   *   @
  140.   (u* food ( 5  8 15 8 4 50 200 200 400 800))
  141.   (u* fuel ( 0  0  0 0 0 50 200 200 400 800))
  142.   (u* ammo ( 5 10 10 3 1 25 100 100 200 400))
  143. )
  144.  
  145. ;; A game's starting units will be full by default.
  146. (table unit-initial-supply (u* m* 9999))
  147.  
  148. ;;; Vision.
  149.  
  150. (add places already-seen 100)
  151.  
  152. (add cities see-always true)
  153.  
  154. (table visibility
  155.   (u* t* 100)
  156.   (t t* 10)
  157.   (t (mountains forest) 1)
  158. )
  159. ;                    m i c p t T n / *  @
  160. (add u* stack-order (3 4 5 2 1 6 7 8 9 10))
  161.  
  162. ;;; Actions.
  163.  
  164. ;                      m  i  c  p  t  T  n  /  *  @
  165. (add u* acp-per-turn ( 2  2  4  2  2  6  4  1  1  1))
  166. (add movers acp-min  (-1 -1 -2 -1 -1 -3 -2))
  167.  
  168. ;;; Movement.
  169.  
  170. (add places speed 0)
  171. (add movers speed 100)
  172.  
  173. ;(table mp-to-enter-unit
  174. ;   (u* u* 1)
  175. ;   (T n 6)
  176. ;)
  177. ; the above don't seem to work properly...
  178. (table mp-to-enter-unit
  179.    (u* u* 0)
  180. )
  181.  
  182. (table mp-to-enter-terrain 
  183.   (u* t* 99)
  184.   (ground (plains desert) 1)
  185.   (ground (forest mountains) 2)
  186.   (n water (1 2))
  187.   (c (forest mountains) (3 4))
  188.   ((m p t) swamp 2)
  189.   (movers railway 0)
  190. ;                m i c p t T n 
  191.   (movers river (2 2 4 2 2 6 1))
  192. ;                          ^
  193. ; should be 99, but then trains can't cross rivers even on bridges
  194. )
  195. (table mp-to-traverse
  196.   (movers river 99)
  197.   (n river 2)
  198.   (movers railway 1)
  199.   ((c n) railway (2 99))
  200. )
  201.  
  202. (table material-to-move ((n T) fuel 1))
  203. (table consumption-per-move ((n T) fuel 1))
  204.  
  205. ;;; Construction.
  206.  
  207. ;           m  i  c  p  t  T  n  / * @
  208. (add u* cp (8 12 20 20 16 16 34 12 1 1))
  209. (table acp-to-create
  210.   (troops / (2 2 4))
  211.   (cities movers 1)
  212.   )
  213. (table cp-on-creation
  214.   (troops / 1)
  215.   (* movers 1)
  216.   (@ movers 2)
  217.   )
  218. (table acp-to-build
  219.   (troops / (2 2 4))
  220.   (cities movers 1)
  221.   )
  222. (table cp-per-build
  223.   (troops / (1 2 1))
  224.   (* movers 1)
  225.   (@ movers 2)
  226.   )
  227. (table occupant-can-construct
  228.   (u* u* false)
  229.   )
  230.  
  231. ;(define constr (i c p t  T  n))
  232. ;(table tp-to-build
  233. ;     (* constr (8 8 6 6 20 20))
  234. ;     (@ constr (4 4 3 3 10 10))
  235. ;)
  236. ;(table acp-to-toolup (cities constr 1))
  237. ;(table tp-per-toolup (cities constr 1))
  238. ;(table tp-max        (cities constr 100))
  239. ; the above make construction of i c p t T n impossible
  240.  
  241. ;;; Repair.
  242.  
  243. ;; Automatic repair work.
  244. (add (  m    i    c    n    /    *    @ ) hp-recovery 
  245.      (0.25 0.50 0.25 0.50 0.25 0.50 1.00)
  246. )
  247.  
  248. ;;; Explicit repair actions accelerate the recovery of lost hp.
  249.  
  250. (table acp-to-repair
  251.   (places u* 1)
  252.   (n movers 1)
  253.   ((m i) places 1)
  254. )
  255. (table hp-per-repair
  256.   (/ u* 0.50)
  257.   (cities u* 1.00)
  258.   (n ground 0.50)
  259.   (n n 0.50)
  260.   (i places 1.00)
  261.   (m places 0.50)
  262. )
  263.  
  264. ;;; Production.
  265.  
  266. (table base-production
  267.   (ground food 1)
  268.   (c food 2)
  269. ; until troop to get food from terrain
  270.   (places fuel (10 20 40))
  271.   (places food (10 20 40))
  272.   (places ammo ( 5 10 20))
  273. )
  274. (table productivity
  275.   (u* t* 0)
  276.   (ground (plains forest) 100)
  277.   (c forest 50)
  278.   (/ dry-land (100 50 30 30))
  279.   (* dry-land (100 50 30 30))
  280.   (@ dry-land (100 50 30 30))
  281. )
  282. ; the above does not work :-)
  283.  
  284. ; (table terrain-storage-x ((forest plains) food (3 12)))
  285. ; (table terrain-initial-supply ((forest plains) food (3 12)))
  286. ; (table terrain-base-production ((forest plains) food (1 3)))
  287. ; but then no way for troop to get food from terrain
  288.  
  289. (table base-consumption
  290.   (movers food 1)
  291.   ((c T) food (2 0))
  292. )
  293. (table hp-per-starve
  294.   (movers food 0.5)
  295. )
  296.  
  297. ;;; Combat.
  298.  
  299. ;                        m i c p t T n /  *  @
  300. (add u* hp-max          (2 3 2 2 1 1 8 5 10 25))
  301. ;(add u* hp-at-min-speed(0 0 0 1 0 0 2 1  3  5)) ; broken?
  302.  
  303. (table hit-chance
  304. ;         m  i  c  p  t  T  n  /  *  @
  305.   (m u* (70 50 40 50 50 50 10 30 25 15))
  306.   (i u* (80 70 50 80 75 70 20 50 40 30))
  307.   (c u* (80 60 80 80 80 60 00 30 20 10))
  308.   (p u* (40 30 30 50 75 40 00 05 20 10))
  309.   (t u* (40 30 10 10 75 40 20 40 60 50))
  310.   (T u* 0)
  311.   (n u* (60 50 30 60 30 70 60 60 70 80))
  312.   (/ u* (60 50 60 60 10 30 10 00 00 00))
  313.   (* u* (40 35 40 50 05 40 20 00 00 00))
  314.   (@ u* (60 50 60 70 05 50 30 00 00 00))
  315. )
  316.  
  317. (table damage
  318.   (u* u* 1)
  319. ;         m i c p t T n / * @
  320.   (t u* ( 2 3 2 1 1 1 2 5 5 9 ))
  321.   (n u* ( 2 2 2 2 1 1 2 2 3 4 ))
  322. )
  323. ; does the above really work?
  324.  
  325. (table capture-chance
  326.   ((m i c) T (30 50 40))
  327.   (m places (10 20 15))
  328.   (i places (20 40 30))
  329.   (c places ( 5 20 15))
  330. )
  331.  
  332. (table independent-capture-chance
  333.   (p movers 50) 
  334.   (p (p t) 0)
  335.   ((m i c) T (60 90 70))
  336.   (m places (20 40 30))
  337.   (i places (40 75 60))
  338.   (c places (10 40 30))
  339.   (i n 30)
  340. )
  341.  
  342. (table ferry-on-entry
  343.    (u* u* over-own)
  344.    (n movers over-border)
  345. )
  346. (table ferry-on-departure
  347.    (u* u* over-own)
  348.    (n movers over-border)
  349. )
  350. (table bridge (i places true) (p movers true))
  351.  
  352. (table protection 
  353.   (/ movers 80)
  354.   (* movers 65)
  355.   (@ movers 50)
  356.   (i places (70 80 80))
  357.   ((m c) places 90)
  358. )
  359.  
  360. (table consumption-per-attack (u* ammo 1))
  361. (table hit-by (u* ammo 1))
  362.  
  363. (table acp-to-attack
  364.   (m u* 2)
  365.   (i u* 2)
  366.   (c u* 4)
  367.   (p u* 2)
  368.   (t u* 1)
  369.   (n u* 1)
  370. )
  371.  
  372. ;;; Revolt & surrender.
  373.  
  374. (table surrender-range (u* u* 1))
  375.  
  376. (table defend-terrain-effect
  377.    ((m i) mountains (80 90))
  378.    ((m i) forest (90 95))
  379.    (/ mountains 80)
  380.    (n shallows 150)
  381. )
  382.  
  383. ; this is a civil war:  everybody revolts and turns coat
  384. (add u* acp-to-change-side 1)
  385. ; excluding politically-aware units
  386. (add (p t) acp-to-change-side 0)
  387.  
  388. (add places revolt-chance 0.50)
  389. (add movers revolt-chance 0.15)
  390. (add (p t) revolt-chance 0.00)
  391. (add m revolt-chance 0.30)
  392.  
  393. (table surrender-chance
  394.   (m u* 1.00)
  395.   (u* u* 0.50)
  396.   ((i c @) u* 0.20)
  397.   (/ u* 0.10)
  398.   (n u* 0.05)
  399.   ((p t) u* 0.00)
  400.   (t p 0.10)
  401.   (u* (t /) 0)
  402. )
  403.  
  404. (add p possible-sides '(not "independent"))
  405. (add t possible-sides '(not "independent"))
  406.  
  407. (table can-enter-independent (t (T * @) true))
  408. ; should be able to enter even hostile units!
  409.  
  410. ;;; Spying.
  411.  
  412. (add p spy-chance 25.00)
  413. (add p spy-range 2)
  414.  
  415. ;;; Accidents.
  416.  
  417. (table attrition
  418.   (n shallows 4.00)
  419.   (troops swamp 5.00)
  420.   (c (mountains forest desert) (2.00 1.00 1.00))
  421. )
  422.  
  423. ;;; Scoring.
  424.  
  425. (add u* point-value 0)
  426. (add (i c / * @) point-value (1 1 1 10 30))
  427.  
  428. ;;; Initial setup.
  429.  
  430. (table favored-terrain
  431.   (n water (100 20))
  432.   (ground plains 100)
  433.   (ground forest 20)
  434.   (t (plains forest) (50 100))
  435. ;               ~   +  %  ^
  436.   (/ dry-land (20 100 10 20))
  437.   (@ dry-land (25 100 10 10))
  438.   (* dry-land (40 100 20 20))
  439. )
  440.  
  441. (table independent-density add (places t* (10 100 30)))
  442.  
  443. (add @ start-with 1)
  444. (add * independent-near-start 3)
  445. (set country-separation-min 12)
  446. (set country-separation-max 60)
  447. (set country-radius-min 4)
  448.  
  449. ;; Naming.
  450.  
  451. (include "town-names")
  452. (add places namer "random-town-names")
  453.  
  454. ;; Sides.
  455.  
  456. (set sides-min 2)
  457. (scorekeeper (do last-side-wins)) ; for now
  458.  
  459. (set side-library '(
  460. ; ------------ parties
  461.   ((noun "Bolshevik") (color "red") (emblem-name "hammer-and-sickle"))
  462.   ((noun "Red") (color "red") (emblem-name "soviet-star"))
  463.   ((noun "Menshevik") (color "black,pink"))
  464.   ((noun "Tzarist") (color "blue") (emblem-name "arms-russia"))
  465.   ((noun "White") (color "white,black") (emblem-name "arms-russia"))
  466. ; ------------ peoples
  467.   ((noun "Russian") (color "blue,red")
  468.                     (emblem-name "flag-russia"))
  469.   ((noun "Ukrainian") (color "yellow,blue")
  470.                       (emblem-name "flag-ukraine"))
  471.   ((noun "Georgian") (emblem-name "flag-georgia"))
  472.   ((noun "Azer") (emblem-name "flag-azerbaijan"))
  473.   ((noun "Armenian") (emblem-name "flag-armenia"))
  474.   ((noun "Cossack") (color "white,blue"))
  475. ; ------------ foreign powers
  476.   ((noun "Polish") (color "white,red") (emblem-name "flag-poland"))
  477.   ((noun "Czechoslovak") (color "red,blue")
  478.                          (emblem-name "flag-czech"))
  479.   ((noun "German") (color "gray,black,white")
  480.                    (emblem-name "german-cross"))
  481.   ((noun "Turkish") (emblem-name "crescent"))
  482.   ((noun "Japanese") (color "red,white,black")
  483.                      (emblem-name "flag-japan"))
  484. ; ((noun "Chinese") (color "red,yellow") (emblem-name "flag-dragon")) 
  485. ))
  486.  
  487.  
  488. (game-module (design-notes (
  489.   "This game is under developement;"
  490.   "Massimo Campostrini (campo@sunthpi3.difi.unipi.it)."
  491.   ""
  492.   "Tooling up does not work, so it is commented out."
  493.   ""
  494.   "Troops seem to be unable to collect food from terrain,"
  495.   "so terrain-storage-x and friends are commented out"
  496.   "and troops make their own food."
  497.   ""
  498.   "Police is supposed to be able to capture neutral troops;"
  499.   "need to implement this in Xconq 7.0"
  500. )))
  501. (game-module (notes (
  502.   "This games tries to model Russia at the time of the Revolution."
  503.   ""
  504.   "About 60% of your production should be infantry",
  505.   ""
  506.   "Trains can move your troops around fast,"
  507.   "but they should never get close to the front."
  508.   ""
  509.   "Terrorists should infiltrate enemy territory"
  510.   "and blow up trains and other things."
  511.   "Police should try to avoid this."
  512.   ""
  513.   "A fort can be built to block a railway."
  514. )))
  515.